package xian.woniu.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xian.woniu.entity.Lable;
import xian.woniu.mapper.LableMapper;
import xian.woniu.service.ILableService;

import java.util.List;
@Service
@Transactional
public class LableServiceImpl implements ILableService {
    private LableMapper lableMapper;

    public LableServiceImpl(LableMapper lableMapper) {
        this.lableMapper = lableMapper;
    }

    @Override
    public void addLable(Lable lable) {
        lableMapper.insertSelective(lable);
    }

    @Override
    public void deleteLable(Integer lid) {
        lableMapper.deleteByPrimaryKey(lid);
    }

    @Override
    public void updateLable(Lable lable) {
        lableMapper.updateByPrimaryKeySelective(lable);
    }

    @Override
    public List<Lable> findAllLable() {
        return lableMapper.selectByExample(null);
    }

    @Override
    public Lable findLableByLid(Integer lid) {
        return lableMapper.selectByPrimaryKey(lid);
    }
}
